﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="INGRESOPARTESMANTENIMIENTO.aspx.vb" Inherits="IMSS.SA.Formulario_web14" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style1
        {
            text-align: center;
        }
        .style2
        {
            text-align: center;
        }
        .style3
        {
            width: 502px;
            text-align: center;
        }
        .style4
        {
            width: 502px;
            text-align: right;
        }
        .style5
        {
            text-align: right;
            width: 482px;
        }
        .style7
        {
            width: 482px;
            text-align: center;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table style="width: 100%; color: #FFFFFF; background-color: #006699; background-image: url('../Styles/r3.PNG'); background-repeat: no-repeat; text-align: left;">
        <tr>
            <td class="style2" colspan="2">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style2" colspan="2">
                <asp:Label ID="Label1" runat="server" Text="Label" Visible="False"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="style2" colspan="2">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style2" colspan="2">
                INGRESO DE PARTES DE MANTENIMIENTO</td>
        </tr>
        <tr>
            <td class="style3">
                </td>
            <td class="style5">
                </td>
        </tr>
        <tr>
            <td class="style3">
                ID_MANTENIMIENTO</td>
            <td class="style7">
                <asp:TextBox ID="TexMANTENIMIENTO" runat="server" MaxLength="15"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style3">
                ID_PARTE
            </td>
            <td class="style7">
                <asp:TextBox ID="TexPARTE" runat="server" MaxLength="15"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style3">
                FECHA</td>
            <td class="style7">
                <asp:TextBox ID="TexFECHA" runat="server" MaxLength="15"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style3">
                CANTIDAD</td>
            <td class="style7">
                <asp:TextBox ID="TexCANTIDAD" runat="server" MaxLength="15"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style3">
                &nbsp;</td>
            <td class="style7">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style3">
                <asp:Button ID="ENVIAR" runat="server" Text="ENVIAR" />
            </td>
            <td class="style7">
                <asp:Button ID="BORRAR" runat="server" Text="BORRAR" />
            </td>
        </tr>
        <tr>
            <td class="style4">
                &nbsp;</td>
            <td class="style5">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style1" colspan="2">
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                    DataKeyNames="Id_mantenimiento,Id_partes" DataSourceID="SqlDataSource1" 
                    Width="847px">
                    <Columns>
                        <asp:BoundField DataField="Id_mantenimiento" HeaderText="Id_mantenimiento" 
                            ReadOnly="True" SortExpression="Id_mantenimiento" />
                        <asp:BoundField DataField="Id_partes" HeaderText="Id_partes" ReadOnly="True" 
                            SortExpression="Id_partes" />
                        <asp:BoundField DataField="Fecha" HeaderText="Fecha" SortExpression="Fecha" />
                        <asp:BoundField DataField="Cantidad" HeaderText="Cantidad" 
                            SortExpression="Cantidad" />
                    </Columns>
                </asp:GridView>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:IMSS.SAConnectionString8 %>" 
                    DeleteCommand="DELETE FROM [PARTES MANTENIMIENTO] WHERE [Id_mantenimiento] = @Id_mantenimiento AND [Id_partes] = @Id_partes" 
                    InsertCommand="INSERT INTO [PARTES MANTENIMIENTO] ([Id_mantenimiento], [Id_partes], [Fecha], [Cantidad]) VALUES (@Id_mantenimiento, @Id_partes, @Fecha, @Cantidad)" 
                    SelectCommand="SELECT [Id_mantenimiento], [Id_partes], [Fecha], [Cantidad] FROM [PARTES MANTENIMIENTO]" 
                    UpdateCommand="UPDATE [PARTES MANTENIMIENTO] SET [Fecha] = @Fecha, [Cantidad] = @Cantidad WHERE [Id_mantenimiento] = @Id_mantenimiento AND [Id_partes] = @Id_partes">
                    <DeleteParameters>
                        <asp:Parameter Name="Id_mantenimiento" Type="String" />
                        <asp:Parameter Name="Id_partes" Type="String" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:ControlParameter ControlID="TexMANTENIMIENTO" Name="Id_mantenimiento" 
                            PropertyName="Text" Type="String" />
                        <asp:ControlParameter ControlID="TexPARTE" Name="Id_partes" PropertyName="Text" 
                            Type="String" />
                        <asp:ControlParameter ControlID="TexFECHA" DbType="Date" Name="Fecha" 
                            PropertyName="Text" />
                        <asp:ControlParameter ControlID="TexCANTIDAD" Name="Cantidad" 
                            PropertyName="Text" Type="Decimal" />
                    </InsertParameters>
                    <UpdateParameters>
                        <asp:Parameter DbType="Date" Name="Fecha" />
                        <asp:Parameter Name="Cantidad" Type="Decimal" />
                        <asp:Parameter Name="Id_mantenimiento" Type="String" />
                        <asp:Parameter Name="Id_partes" Type="String" />
                    </UpdateParameters>
                </asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td class="style3">
                &nbsp;</td>
            <td class="style1" colspan="2">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style3">
                &nbsp;</td>
            <td class="style5">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style3">
                &nbsp;</td>
            <td class="style5">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
    </table>
</asp:Content>
